package com.dingup.provider.mapper;

import com.dingup.api.enums.ThirdPartyTypeEnum;
import com.dingup.api.model.sys.ThirdPartyUserInfo;
import org.apache.ibatis.annotations.Param;

import static com.dingup.provider.util.ConstUtil.*;

/**
 * Created by jun on 2018/8/7.
 */
public interface ThirdPartyUserInfoMapper {
    Boolean add(ThirdPartyUserInfo thirdPartyUserInfo);

    Boolean existUserId(
            @Param(PARAM_USER_ID) String userId,
            @Param(PARAM_THIRD_PARTY_TYPE) ThirdPartyTypeEnum thirdPartyType);

    Boolean existThirdPartyUserId(
            @Param(PARAM_THIRD_PARTY_USER_ID) String thirdPartyUserId,
            @Param(PARAM_THIRD_PARTY_TYPE) ThirdPartyTypeEnum thirdPartyType);

    ThirdPartyUserInfo getByUserIdAndThirdPartyType(
            @Param(PARAM_USER_ID) String userId,
            @Param(PARAM_THIRD_PARTY_TYPE) ThirdPartyTypeEnum thirdPartyType);

    ThirdPartyUserInfo getByThirdPartyUserIdAndThirdPartyType(
            @Param(PARAM_THIRD_PARTY_USER_ID) String thirdPartyUserId,
            @Param(PARAM_THIRD_PARTY_TYPE) ThirdPartyTypeEnum thirdPartyType);

    Boolean updateThirdPartyUserId(ThirdPartyUserInfo thirdPartyUserInfo);


}
